/*
This function polls the microphone n times and stores the floating point representation 
	 of the input in q. q must be a statically declared array of floating points of size n
Input
	q - array used to store floating point samples. must be at least as large as n
	n - the number of samples you want to take
After the function
	q will have n floating point numbers sampled from the spi device
Returns
	nothing
Note: spi polling without the floating point conversion will result in sampling frequencies as high as 68000Hz.
	with the floating point conversion, the spi reads at around 7000Hz. 
	the sampling frequency could be controlld through periodic interrupts
*/

#ifndef SPI_H
#define SPI_H

#include "xparameters.h"
/*xil_xspi_l.h is a copy of xspi_l.h
this copy is used because XPS service pack 2 replaced the functions with the direct i/o commands of the functions
this allows our spi function to work in both sp1 and sp2
*/
#include "xil_xspi_l.h"
#include "xbasic_types.h"

#define BaseAddress XPAR_XPS_SPI_0_BASEADDR
#include "spi.c"

void spi_read(float* q,int n);

#endif
